const mongoose = require("./db.js");

// 创建集合字段的约束对象
const userSchema = new mongoose.Schema({
  userId: {type: String},
  username: {type: String},
  password: {type: String},
  tel: {type: String},
  email: {type: String},
  power: {type: Number},
  isVIP: {type: Boolean},
  hobby: {type: Array}
})

// 创建集合并暴露出去
module.exports = mongoose.model( "user", userSchema );
